package cn.com.flat.mybatis.jdbc.dialect;

/**
 * 标题: Mysql方言
 * <p>
 * 描述: Mysql方言
 * <p>
 * 版权：Copyright (c) 2016
 * <p>
 *
 * @author 张顺
 * @version 1.0
 * @created 2016/11/09/23:06
 */
public class MySqlDialect extends  Dialect{
    @Override
    public boolean supportsLimit() {
        return true;
    }

    @Override
    public boolean supportsLimitOffset() {
        return true;
    }

    @Override
    public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) {
        if (offset > 0){
            return sql + "limit" + offsetPlaceholder + "," +limitPlaceholder;
        }
        return sql + "limit" +limitPlaceholder;
    }
}
